package com.zhuqi.service.impl;

import com.zhuqi.domain.ChatMessageDo;
import com.zhuqi.mapper.ChatMessageMapper;
import com.zhuqi.service.ChatMessageService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ChatMessageServiceImpl implements ChatMessageService{

    @Resource
    private ChatMessageMapper chatMessageMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return chatMessageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(ChatMessageDo record) {
        return chatMessageMapper.insert(record);
    }

    @Override
    public int insertSelective(ChatMessageDo record) {
        return chatMessageMapper.insertSelective(record);
    }

    @Override
    public ChatMessageDo selectByPrimaryKey(Integer id) {
        return chatMessageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(ChatMessageDo record) {
        return chatMessageMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(ChatMessageDo record) {
        return chatMessageMapper.updateByPrimaryKey(record);
    }

	/**
	 * 根据用户名查询以前的消息
	 *
	 * @param username 用户名
	 * @return
	 */
	@Override
	public List<ChatMessageDo> selectByUserName(String username) {
		return chatMessageMapper.selectByUserName(username);
	}
}
